package com.tm.biz.controller;

import com.tm.biz.feignclient.OrderClient;
import com.tm.biz.feignclient.StorageClient;
import com.tm.biz.service.BizService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping
public class BizController {

    private final BizService bizService;

    public BizController(BizService bizService) {
        this.bizService = bizService;
    }

    @PostMapping("createOrders")
    @GlobalTransactional
    public Boolean createOrders(@RequestBody Map<String,String> map){
        bizService.createOrders(map);

        return Boolean.TRUE;
    }
}
